import request from '@/utils/request'
// 获取企业部门列表
export const reqGetDepts = () => {
  return request({
    method: 'get',
    url: '/company/department'
  })
}

// 删除部门
export const reqDelDept = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}` // 要删除部门的id
  })
}
// 新增部门
export const reqAddDept = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data // data要一个对象需要5个字段
  })
}
// 根据id获取部门详情
export const reqGetDeptDetailById = (id) => {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}

// 编辑提交修改部门信息
export const reqUpdateDept = (obj) => {
  return request({
    method: 'put',
    url: `/company/department/${obj.id}`,
    data: obj
  })
}
